package com.visionet.school.app.web.entity.enums;

/**
 * Created by hxpeng on 2017/3/9.
 */
public enum UserStatus {

    NORMAL("normal","正常状态"),
    LOCKED("locked","账户已锁定"),
    INVALID("invalid","账户已失效");

    private String key;
    private String value;
    UserStatus(String key, String value){
        this.key = key;
        this.value = value;
    }
    public static UserStatus fromCode(String key){
        for (UserStatus type : values()){
            if(type.key.equalsIgnoreCase(key)){
                return type;
            }
        }
        return null;
    }
    public String toKey() {
        return key;
    }
    public String getValue() {
        return value;
    }

}
